{$CLEO .cs}
{$USE cleo+}
0000:

model.Load(#GRENADE)
model.Load(#AK47)
model.Load(#HUNTLEY)
038B: load_requested_models
  0ACA: show_text_box "Ready to go!"
30@=object.Init(#GRENADE ,4382.022, -3109.6416, 10.5254 )
//0382: set_object 30@  collision_detection 1
//0750: set_object 30@ visibility 1

marker.CreateAboveObject(5@ , 30@ )

while true 
wait 0
 
        if  and 
        8474:  not   actor $PLAYER_ACTOR near_object_in_cube 30@ radius 30.0 30.0 30.0 sphere 0
         33@ > 1000
        then
            if 06BD:   no_obstacles_between 20@ 21@ 22@ and 23@ 24@ 25@  solid 0 car 1 actor 1 object 0 particle 0
            then
               2@=car.Create(#HUNTLEY , 26@ ,27@, 28@)
               33@=0
               wait 1000
               car.Destroy(2@  )
            end
        end
        0400: store_coords_to 20@ 21@ 22@ from_object 30@ with_offset -14.0 -14.0 8.0
        0400: store_coords_to 23@ 24@ 25@ from_object 30@ with_offset  14.0  14.0 -1.0
        0400: store_coords_to 26@ 27@ 28@ from_object 30@ with_offset 0.0 0.0 -1.0     //SPAWN
        
        0209: 17@ = random_int_in_ranges 0 4
        if 17@ == 0 
        then
             object.PutAt(30@,4382.0444, -3090.5269, 10.3754 )
        end 
        if 17@ == 1
        then
             object.PutAt(30@,4452.1958, -3091.3364, 10.3754 )
             
        end 
        if 17@ == 2
        then
             object.PutAt(30@, 4451.5781, -3111.2043, 10.3523) 
        end 
        if 17@ == 3
        then
             object.PutAt(30@,4382.022, -3109.6416, 10.5254 )
        end 
        
        if 32@ > 10000
        then
        object.Destroy(30@ )
          0ACA: show_text_box "Test done!"
          end_Thread
        end 
end 
0A93: terminate_this_custom_script